<template>
    <div class="container">
        <el-alert :title="title" :description="description" :info1="execTitle" :info2="execDescription"
                  :type="propJson.type"
                  :effect="propJson.effect"
                :closable="propJson.isClosable"
                :center="propJson.isCenter"
                :show-icon="propJson.isShowIcon"/>
    </div>
</template>

<script>
import {doThirdServiceValue} from "@/request/lowcode/thirdService";

export default {
    name: "AlertMessageComponent",
    props: ['propJson', 'commonParam'],
    data() {
        return {
            title: "",
            description: ""
        }
    },
    methods: {
        execTitleThen(resValue, execParam) {
            this.title = resValue;
        },
        execDescriptionThen(resValue, execParam) {
            this.description = resValue;
        }
    },
    computed: {
        async execTitle() {
            if (this.propJson.editFlag) {
                return;
            }
            await doThirdServiceValue(this.propJson.titleActionInfo, this.commonParam, this.execTitleThen, () => {}, null)
        },
        async execDescription() {
            if (this.propJson.editFlag) {
                return;
            }
            await doThirdServiceValue(this.propJson.descriptionActionInfo, this.commonParam, this.execDescriptionThen, () => {}, null)
        }
    }
}
</script>

<style scoped lang="less">

</style>